perm filename HOARE.NOT[LSP,JRA] blob
sn#065025 filedate 1973-10-01 generic text, type C, neo UTF8
COMMENT ā VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002
C00007 ENDMK
Cā;
D. Luckham suggested I talk with you concerning some ideas I have
about the teaching of programming languages.
Rather than take too much of your time I thought that it would be better
to write down a few of my arguments and you could comment on their merits
if you wished.
In a phrase, I believe that LISP should be the first language seen by Computer
Science students. I believe that it is unsurpassed for describing compilation
and evaluation processes and for motivating implementation techniques.
It has the benefit of staying clear of machine language for description of
algorithms. The power and simplicity of LISP and the `eval' function is
useful to motivate a `real' machine when the finer details of implementation and
compilation arise.
The enclosed UCLA outline was a course I developed over a two year period.
The students were upperdivision but had a very minimal C.S. background. Most
students had never seen assemblers, compilers, list structure or anything
very interesting.
The course structure was motivated as follows:
1) First the basic operations and mechanics of writing recursive functions
as Mexprs. In the homework, subsets of eval are given with arguments
to be evaluated. This way the students use eval before they get scared
by knowing what it means.
2) Then a complex `everyday' algorithm is mechanized as a LISP function. This
requires representing the domain as Sexprs. For science students, the
differentiation algorithm for polynomials is excellent.
3) Then we claim that the process which we have been using to evaluate LISP
expressions can be mechanized. In fact it is recursive. The mechanization
comes in three stages: a)primitive LISP functions, composition, but only
constant arguments. b) then add conditional expressions, and finally 3),
describe variable bindings and symbol tables.
4) The final link is to notice the parallel between the differentiation example
and the intuitive evaluation proceess:
differentiation
informal recursive algorithm ===> LISP function
domain(of polynomials) ===> Sexprs
evaluation by value
informal recursive algorithm ===> LISP function
domain(of Mexpr forms) ===> Sexprs
This makes the Mexpr-Sexpr translation quite natural.
With this background in LISP, two continuations arise: first the implementation
describing stacks, free space, symbol tables, and garbage collection; and
second, semantics, compilation, extensibility and syntax-directed processes.
Clearly, there are alternative ways to introduce these topics but I believe
that LISP, taught in this style (with the emphasis on `eval') really
clarifies the topics.
I would be interested in any comments you would like to make.
John Allen